package com.sina.interfaces.domain.user;

import com.sina.interfaces.core.domain.Domain;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;

/**
 * Created with IntelliJ IDEA
 * description:
 * 段浩杰 2017-10-23 21:16
 */
@Entity
@Table(name = "in_history")
@DynamicUpdate
@DynamicInsert
public class History extends Domain {

    @Id
    @Column(name = "id", updatable = false)
    @GenericGenerator(name = "sequence_id", strategy = "com.sina.interfaces.core.sequence.IdGenerator")
    @GeneratedValue(generator = "sequence_id")
    @Min(1)
    private Long id;

    @NotNull
    @Column(name = "url")
    private String url;

    @NotNull
    @Column(name = "status")
    private Status status;

    @NotNull
    @Column(name = "params")
    private String params;

    @NotNull
    @Column(name = "result")
    private String result;

    @NotNull
    @Column(name = "times")
    private int times;

    @NotNull
    @Column(name = "date_time")
    private LocalDate dateTime;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Status getStatus() {
        return status;
    }

    public void setStatus(Status status) {
        this.status = status;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public int getTimes() {
        return times;
    }

    public void setTimes(int times) {
        this.times = times;
    }

    public LocalDate getDateTime() {
        return dateTime;
    }

    public void setDateTime(LocalDate dateTime) {
        this.dateTime = dateTime;
    }
}
